package com.sxy.demo.sxy;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @Description:
 * @author: xzz
 * @Date: 2024/4/24
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("rme_act_activity_group_info")
/**
 *         select
 *             ag.*
 *         from rme_act_activity ac
 *         join rme_act_activity_group_info ag on ac.id = ag.activity_id and ag.deleted = 0
 *              and ag.spu_id in
 *             <foreach collection="spuIdList" item="item" index="index" open="(" separator="," close=")">
 *                 #{item}
 *             </foreach>
 *         where ac.deleted = 0
 *             and ac.status in
 *             <foreach collection="statusList" item="item" index="index" open="(" separator="," close=")">
 *                 #{item}
 *             </foreach>
 */
public class ActActivityGroupInfo extends BaseEntity {

    /**
     * 活动ID
     */
    @TableField("activity_id")
    private Long activityId;

    /**
     * 标准SPU ID
     */
    @TableField("spu_id")
    private Long spuId;

    /**
     * 商品名称
     */
    @TableField("goods_name")
    private String goodsName;

    /**
     * 商品主图
     */
    @TableField("spu_image")
    private String spuImage;

    /**
     * 最小成团数
     */
    @TableField("min_sale_num")
    private Integer minSaleNum;

    /**
     * 目标成团数
     */
    @TableField("target_sale_num")
    private Integer targetSaleNum;

    /**
     * 已售基数
     */
    @TableField("base_sales_num")
    private Integer baseSalesNum;

    /**
     * 每件可省金额
     */
    @TableField("conserve_money")
    private BigDecimal conserveMoney;

    /**
     * 销售数量
     */
    @TableField("sale_num")
    private Integer saleNum;

    /**
     * 成团状态
     */
    @TableField("group_status")
    private Integer groupStatus;

    /**
     * 完成状态
     */
    @TableField("finish_status")
    private Integer finishStatus;

    /**
     * 成团结束时间
     */
    @TableField("group_end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime groupEndTime;

    /**
     * 拼团结束时间
     */
    @TableField("finish_end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime finishEndTime;
    /**
     * 结束后是否还可以参与
     */
    @TableField("enable_end_participation")
    private Integer enableEndParticipation;

    /**
     * 结束后是否下架商品
     */
    @TableField("enable_down_goods")
    private Integer enableDownGoods;

    /**
     * 链接分享内容
     */
    @TableField("share_link_content")
    private String shareLinkContent;


    /**
     * @see activityId
     */
    private ActActivity activity;
}
